{function name=comments level=0}
    <ul class="level_{$level}">
        {foreach $data as $comment}
			<li rel="{$comment->id}" class="level_{$level}" id="comment_{$comment->id}">
				<div class="comment_entry">
					<div class="author">
						<a href="?module=users&action=user_edit&id={$comment->author}">{$comment->Author->login}</a>
						<span>
							{if date('d.m.Y', time()) == date('d.m.Y', $comment->date_createtime)}
								Сегодня в {date('H:i', $comment->date_createtime)}
							{else}
								{date('d.m.Y H:i', $comment->date_createtime)}
							{/if}
						</span>
						<a href="#comment_{$comment->id}">#</a>
					</div>
					{$comment->text}
					<div class="reply">
						<a href="#" class="reply" rel="{$comment->id}">Ответить</a>
						<a href="#" class="edit" rel="{$comment->id}"><img src="{$tpl_url}images/pencil.png" alt="Edit" /></a>
						<a href="#" class="delete" rel="{$comment->id}"><img src="{$tpl_url}images/trash.png" alt="Delete" /></a>
					</div>
				</div>
                {if count($comment->Answers)}
                    {comments data=$comment->Answers level=$level+1}
                {/if}
            </li>
        {/foreach}
    </ul>
{/function}
<div class="post">
    <h1 class="title">{$post->title}&nbsp;<a href="{$base_url}&action=post_edit&id={$post->id}"><img src="{$tpl_url}images/pencil.png" alt="Edit" /></a></h1>
    <div class="preview">{$post->preview}</div>
    <div class="cut"></div>
    <div class="text">{$post->text}</div>
</div>
<div class="comments" id="comments">
	<h1>Коментарии (<span id="comments_count">{count($post->Comments)}</span>)</h1>
    {comments data=$comments}
	<a href="#" id="add_comment" class="button add_item"><span>Добавить комментарий</span></a>
	<div id="comment_form" style="display: none;">
		{include file="_comment_form.html"}
	</div>
</div>
